﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using STT.Layer.Connection;
namespace STT.Profilehv.UserControls
{
    public partial class ThongTinKhoaHoc : System.Web.UI.UserControl
    {
        ToolBox tb = new ToolBox();
        protected void Page_Load(object sender, EventArgs e)
        {
            LoadKhoaHoc();
        }
        private void LoadKhoaHoc()
        {
            gvKhoaHoc.DataSource = tb.GetDataTableById("GetKhoaHocByMaHV","1");
            gvKhoaHoc.DataBind();
        }
        protected void gvKhoaHoc_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
        {
           
        }

        protected void gvKhoaHoc_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            gvKhoaHoc.PageIndex = e.NewPageIndex;
            LoadKhoaHoc();
        }

        protected void imgbntchitiet_Click(object sender, ImageClickEventArgs e)
        {
            try
            {
                ImageButton imgbnt = sender as ImageButton;
                GridViewRow row = (GridViewRow)imgbnt.NamingContainer;
                string id = gvKhoaHoc.DataKeys[row.RowIndex].Value.ToString();
                DataTable dt = tb.GetDataTableById("GetKhoaHocByMaKhoaHoc", id);
                pnchitietkhoahoc.Visible = true;
                lblnd.Text = dt.Rows[0][2].ToString();
            }
            catch { }
        }

      
    }
}